package com.dongfa.learn_0913;

import java.util.Scanner;

public class LearnCode0922 {
    //判断输入的数字是否为回文数字
    public static void main(String []args){
        System.out.println("请输入一个正整数：");
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        String numChar = num + "";
        String newChar = new StringBuffer(numChar).reverse().toString();
        int newNum = Integer.parseInt(newChar);
        if (newNum == num){
            System.out.println("输入的数字是回文数字");
        }else {
            System.out.println("输入的数字不是回文数字");
        }
    }
}
